import request from '@/utils/request';

//告警分析详情
export function queryDetail(data: anyObj): ApiPromise<ApiResponse> {
	return request({
		url: '/ops-workbench/ywgzt/areaAlarm/detail/queryById',
		method: 'post',
		data: data,
	});
}

// 全系统总览
export function querySysList(data: anyObj): ApiPromise<ApiResponse> {
	return request({
		url: '/ops-workbench/ywgzt/areaAlarm/detail/systemOverview',
		method: 'post',
		data: data,
	});
}

// 全业务总览
export function queryBusinessList(data: anyObj): ApiPromise<ApiResponse> {
	return request({
		url: '/ops-workbench/ywgzt/areaAlarm/detail/businessOverview',
		method: 'post',
		data: data,
	});
}

/** 下载接口 */
// 系统总览
export function exportSystemOverview(query: anyObj): ApiPromise<ApiResponse> {
	return request({
		url: '/ops-workbench/ywgzt/areaAlarm/detail/systemOverviewExport',
		method: 'post',
		data: query,
		timeout: 3000000,
		responseType: 'blob',
	});
}

// 业务总览
export function exportBusiOverview(query: anyObj): ApiPromise<ApiResponse> {
	return request({
		url: '/ops-workbench/ywgzt/areaAlarm/detail/businessOverviewExport',
		method: 'post',
		data: query,
		timeout: 3000000,
		responseType: 'blob',
	});
}

// 关联告警列表
// 失败率
export function exportFail(query: anyObj): ApiPromise<ApiResponse> {
	return request({
		url: '/ops-workbench/ywgzt/failRate/getBusinessFailDetailListExport',
		method: 'post',
		data: query,
		timeout: 3000000,
		responseType: 'blob',
	});
}

// 响应慢
export function exportResponse(query: anyObj): ApiPromise<ApiResponse> {
	return request({
		url: '/ops-workbench/ywgzt/alarm/responSlow/alarmDetailListExcelExport',
		method: 'post',
		data: query,
		timeout: 3000000,
		responseType: 'blob',
	});
}

// 健康度
export function exportHealth(query: anyObj): ApiPromise<ApiResponse> {
	return request({
		url: '/ops-workbench/ywgzt/alarm/responSlow/singleAlarmDetailListExport',
		method: 'post',
		data: query,
		timeout: 3000000,
		responseType: 'blob',
	});
}

// 关联告警列表
export function queryAlarmDetailList(data: anyObj): ApiPromise<ApiResponse> {
	return request({
		url: '/ops-workbench/ywgzt/areaAlarm/alarmDetailListQuery',
		method: 'post',
		data: data,
	});
}

// 关联告警列表导出
export function alarmDetailListQueryExport(query: anyObj): ApiPromise<ApiResponse> {
	return request({
		url: '/ops-workbench/ywgzt/areaAlarm/alarmDetailListQueryExport',
		method: 'post',
		data: query,
		timeout: 3000000,
		responseType: 'blob',
	});
}

// 失败/告警详单列表
export function alarmTypeToBusinessList(data: anyObj): ApiPromise<ApiResponse> {
	return request({
		url: '/ops-workbench/ywgzt/areaAlarm/detail/alarmTypeToBusinessList',
		method: 'post',
		data: data,
	});
}

// 失败/告警败详单列表导出
export function alarmTypeToBusinessListExport(query: anyObj): ApiPromise<ApiResponse> {
	return request({
		url: '/ops-workbench/ywgzt/areaAlarm/detail/alarmTypeToBusinessListExport',
		method: 'post',
		data: query,
		timeout: 3000000,
		responseType: 'blob',
	});
}
